package com.yunqiao.service.api.mapper;

import com.yunqiao.service.api.entity.UserEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yunqiao.service.api.vo.UserVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;
import java.util.List;

/**
 * 用户表
 *
 * @author Crocutax
 * @email wangxw725@163.com
 * @date 2019-03-02 15:03:56
 */
@Mapper
public interface UserMapper extends BaseMapper<UserEntity> {

    List<UserVo> getSuperiorUserUser(@Param("superiorUserId") Long superiorUserId);

    UserEntity details(@Param("id") Long id);

    int updateBalance(@Param("userId") Long userId, @Param("balance") BigDecimal balance,@Param("blockBalance") BigDecimal blockBalance, @Param("version") Long version);

    List<UserEntity> selectOpenClientIds(@Param("lat") String lat, @Param("lon") String lon,@Param("carType")Integer carType);

    List<String> selectOpenPhone();

    int updateOrderBlockBalance(@Param("userId") Long userId, @Param("balance") BigDecimal balance, @Param("orderBlockBalance") BigDecimal orderBlockBalance, @Param("version") Long version);

    int updateMoneyReward(@Param("userId") Long userId, @Param("moneyReward") BigDecimal moneyReward, @Param("version") Long version);

    List<Long> selectOpenIds();

	void dealOrderMoney();
}
